<?php

    class PhpDbStatement extends PDOStatement // Ainsi un objet de type PhpDbStatement est instanceof PDOStatement
    {
        public $statement = NULL;

        # constructeur
        public function __construct ( &$host, $queryString )
        {
            $class = get_class($host).'Statement';
            $this->statement = new $class($host,$queryString);
        }

        # methodes PhpDb
        public function getQueryString()
        {
            return $this->statement->statement;
        }

        # methodes PDO
        /*bool*/ public function bindColumn ( $column , &$param , $type = NULL , $maxlen = NULL , $driverdata = NULL )
        {
            return $this->statement->bindColumn($column,$param,$type,$maxlen,$driverdata);
        }
        /*bool*/ public function bindParam ( $parameter , &$variable, $data_type = PhpDb::PARAM_STR , $length = NULL , $driver_options = NULL )
        {
            return $this->statement->bindParam($parameter,$variable,$data_type,$length,$driver_options);
        }
        /*bool*/ public function bindValue ( $parameter , $value , $data_type = PhpDb::PARAM_STR )
        {
            return $this->statement->bindValue($parameter,$value,$data_type);
        }
        /*bool*/ public function closeCursor ( )
        {
            return $this->statement->closeCursor();
        }
        /*int*/ public function columnCount ( )
        {
            return $this->statement->columnCount();
        }
        /*bool*/ public function debugDumpParams ( )
        {
            return $this->statement->debugDumpParams();
        }
        /*string*/ public function errorCode ( )
        {
            return $this->statement->errorCode();
        }
        /*array*/ public function errorInfo ( )
        {
            return $this->statement->errorInfo();
        }
        /*bool*/ public function execute ( $input_parameters = array() )
        {
            return $this->statement->execute($input_parameters);
        }
        /*mixed*/ public function fetch ( $fetch_style = PhpDb::FETCH_BOTH , $cursor_orientation = PhpDb::FETCH_ORI_NEXT , $cursor_offset = 0 )
        {
            return $this->statement->fetch($fetch_style,$cursor_orientation,$cursor_offset);
        }
        /*array*/ public function fetchAll ( $fetch_style = PhpDb::FETCH_BOTH , $column_index = 0 , $ctor_args = array() )
        {
            return $this->statement->fetchAll($fetch_style,$column_index,$ctor_args);
        }
        /*string*/ public function fetchColumn ( $column_number = 0 )
        {
            return $this->statement->fetchColumn($column_number);
        }
        /*mixed*/ public function fetchObject ( $class_name = "stdClass", $ctor_args = NULL )
        {
            return $this->statement->fetchObject($class_name,$ctor_args);
        }
        /*mixed*/ public function getAttribute ( $attribute )
        {
            return $this->statement->getAttribute($attribute);
        }
        /*array*/ public function getColumnMeta ( $column )
        {
            return $this->statement->getColumnMeta($column);
        }
        /*bool*/ public function nextRowset ( )
        {
            return $this->statement->nextRowset();
        }
        /*int*/ public function rowCount ( )
        {
            return $this->statement->rowCount();
        }
        /*bool*/ public function setAttribute ( $attribute , $value )
        {
            return $this->statement->setAttribute($attribute,$value);
        }
        /*bool*/ public function setFetchMode ( $mode , $params=NULL )
        {
            return $this->statement->setFetchMode($mode,$params);
        }
    }

?>
